package ca.jerg.wizard;

import java.awt.*;
import javax.swing.*;
import ca.jerg.layout.*;

public class ErgWizardStartPanel extends JPanel
{
	private static final long serialVersionUID = 1L;

	private String DETAILS_TEXT = "Details about wizard";
	private JTextField thresholdPower;
	private JTextField numSets;
	
	public ErgWizardStartPanel() 
    {   	                
		setLayout(new BorderLayout());
		add(getContentPanel());
    }
		
	public String getThresholdPower()
	{
		return thresholdPower.getText();
	}

	public String getNumSets()
	{
		return numSets.getText();
	}

	private JPanel getContentPanel()
	{		
		JPanel detailsPanel = new JPanel();
		detailsPanel.setLayout(new BorderLayout());
				
		// theshold power
		thresholdPower = new JTextField("250");
		thresholdPower.setToolTipText("Enter the rider's threshold power (best average 60 min power).");
		JLabel jLabel1 = new JLabel();
		jLabel1.setText("Threshold Power");
		jLabel1.setLabelFor(thresholdPower);
		
		// number of sets to generate
		numSets = new JTextField("1");
		numSets.setToolTipText("Enter the number of main sets to generate.");
		JLabel jLabel2 = new JLabel();
		detailsPanel.add(jLabel2);
		jLabel2.setText("Number of Sets");
		jLabel2.setLabelFor(numSets);
		
		// the description of the wizard		
		JTextField jTextField1 = new JTextField(DETAILS_TEXT);
		detailsPanel.add(jTextField1);				
		jTextField1.setPreferredSize(new Dimension(370,120));
		jTextField1.setEditable(false);
		jTextField1.setHorizontalAlignment(SwingConstants.CENTER);
		jTextField1.setRequestFocusEnabled(false);
		//jTextField1.setBorder(null);
		
		JPanel panel = new JPanel();
		panel.setLayout(new SpringLayout());
		panel.add(jLabel1);
		panel.add(thresholdPower);
		panel.add(jLabel2);
		panel.add(numSets);
		SpringUtilities.makeCompactGrid(panel,2,2,6,6,6,6);
		
		detailsPanel.add(jTextField1,BorderLayout.NORTH);
		detailsPanel.add(panel,BorderLayout.CENTER);
		
		JPanel contentPanel = new JPanel();
		contentPanel.setLayout(new BorderLayout());
		contentPanel.add(detailsPanel,BorderLayout.CENTER);
		
		return contentPanel;		
	}
}
